<!-- 主页 -->
<template>
  <div class="home-wrap">
    <!-- 轮播图左右两个箭头 -->
    <div class="icon-left">
      <i class="iconfont icon-angle-left"></i>
    </div>
    <div class="icon-right">
      <i class="iconfont icon-angle-right"></i>
    </div>
    <!-- 轮播图左右两个箭头 -->
    <div class="container">
      <!-- 轮播图 -->
      <el-carousel :interval="4000" height="800px" arrow="always" >
        <el-carousel-item>
          <img
            src="http://www.streetwill.co/uploads/post/photo/140/medium_iVuOvujKSSu18HTI5-2ZSTX8rgmO0YBy05EM19EDfd8.jpg"
            alt=""
          />
        </el-carousel-item>
        <el-carousel-item>
          <img
            src="https://i0.hippopx.com/photos/163/657/216/beach-dominican-republic-dominican-caribbean-preview.jpg"
            alt=""
          />
        </el-carousel-item>
        <el-carousel-item>
          <img
            src="../../assets/image/medium_E7hI_BSbJy3bb4J7x8-SXoOixFU9G2IqKF-XimJ-CH8.jpg"
            alt=""
          />
        </el-carousel-item>
      </el-carousel>
      <!-- 轮播图 -->
      <!-- 最新动态 -->
      <div class="last-news">
        <div class="last-news-tag">
          <p>最新动态</p>
        </div>
        <div class="news-box">
          <home-article-box
            v-for="(item, index) in 8"
            :key="item"
            :image="imgList[index]"
          />
        </div>
      </div>
      <!-- 最新动态 -->
      <!-- 关于 -->
      <div class="about-me">
        <div class="about-me-tag">
          <p>关于</p>
        </div>
        <div class="reason-wrapper">
          <div class="reason-wrapper-left">
            <img src="../../assets/image/dance.gif" alt="">
            <div class="about-blog">
              <span>网站简介</span>
              <div>
                
              </div>
            </div>
          </div>
          <div class="reason-wrapper-right"></div>
        </div>
      </div>
      <!-- 关于 -->
    </div>
  </div>
</template>

<script>
import HomeArticleBox from "../../components/common/HomeArticleBox.vue";
import { ref } from "vue";
export default {
  components: { HomeArticleBox },
  setup() {
    const imgList = ref([
      "http://api.lvyestudy.com/upload/courses/696612g2b3565a15eeb4ged6.jpg",
      "http://api.lvyestudy.com/upload/courses/02396c3dgf5c0ea702dd696e.jpg",
      "http://api.lvyestudy.com/upload/courses/0a23d9abd5055da6129586c3.jpg",
      "http://api.lvyestudy.com/upload/courses/f896g990d5000591f0d960bb.jpg",
      "http://api.lvyestudy.com/upload/courses/2a6acf9365528b6feba3aeg4.jpg",
      "http://api.lvyestudy.com/upload/courses/b7ggffd1d82b8344196342g0.jpg",
      "http://api.lvyestudy.com/upload/courses/1631g8fg5ag9dc3220bf446d.jpg",
      "http://api.lvyestudy.com/upload/courses/g89fb7394115b0fe97743549.jpg",
    ]);
    const next = () => {
      console.log('next');
    }
   return {
      imgList,
      next
    };
  },
};
</script>
<style lang='less' scoped>
.home-wrap {
  position: relative;
  padding: 20px 0;
  .icon-left {
    position: absolute;
    width: 50px;
    height: 80px;
    line-height: 80px;
    left: 100px;
    top: 400px;
    background-color: pink;
    text-align: center;
    color: white;
    transform: translateY(-40px);
    .iconfont {
      font-size: 30px;
    }
  }
  .icon-right {
    position: absolute;
    width: 50px;
    height: 80px;
    line-height: 80px;
    right: 100px;
    top: 400px;
    background-color: #63cdda;
    text-align: center;
    color: white;
    transform: translateY(-40px);
    .iconfont {
      font-size: 30px;
    }
  }
  .icon-left:hover {
    background-color: #63cdda;
  }
  .icon-right:hover {
    background-color: pink;
  }
  .el-carousel {
    width: 1240px;
    margin: 0 auto;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .last-news {
    &-tag {
      color: rgb(255, 255, 255);
      text-align: center;
      p {
        position: relative;
        width: 320px;
        height: 32px;
        line-height: 32px;
        margin: 50px auto 25px;
        font-size: 18px;
        color: #fff;
        background-image: linear-gradient(90deg, #37f, #87cefa);
      }
      p::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 0;
        border: 16px solid transparent;
        border-left-color: #fff;
      }
      p::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 0;
        border: 16px solid transparent;
        border-right-color: #fff;
      }
    }
    .news-box {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
    }
  }
  .about-me {
    &-tag {
      color: rgb(255, 255, 255);
      text-align: center;
      p {
        position: relative;
        width: 320px;
        height: 32px;
        line-height: 32px;
        margin: 50px auto 25px;
        font-size: 18px;
        color: #fff;
        background-image: linear-gradient(90deg, #37f, #87cefa);
      }
      p::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 0;
        border: 16px solid transparent;
        border-left-color: #fff;
      }
      p::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 0;
        border: 16px solid transparent;
        border-right-color: #fff;
      }
    }
  }
}
</style>